package com.huitone.gddw.listener;

import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.apache.log4j.Logger;
import org.springframework.data.redis.core.StringRedisTemplate;

import com.huitone.gddw.utils.CipherPTUtils;
import com.huitone.gddw.utils.SpringContextUtil;


//初始化密码平台身份认证
public class InitServlet  implements Servlet{
	private final static Logger LOGGER = Logger.getLogger(InitServlet.class);
	@Override
	public void init(ServletConfig config) throws ServletException {
		    new Thread(new Runnable() {
				@Override
				public void run() {
					LOGGER.info("test InitServlet  web项目启动 初始化密码平台身份认证");
					CipherPTUtils.authenticationCipher();
					
					//创建非对称秘钥,返回公钥存到redis
					CipherPTUtils.getKeyPair();
				}
			}).start();
			
	}

	@Override
	public ServletConfig getServletConfig() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public String getServletInfo() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void destroy() {
		// TODO Auto-generated method stub
		
	}

}
